<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>onmouseover</title>
		<style type="text/css">
	#one{width:150px;height:150px;background:lightblue;}
	#two{width:200px;height:40px;border:dashed 2px cyan;margin-top:30px;}


	</style>
</head>
<body>
	<div id ='one'></div>
	<div id ='two'></div>
	<script type="text/javascript">

	//获取元素
	var one =document.getElementById('one');
	var two =document.getElementById('two');

	//鼠标放上去的事件
	one.onmouseover =function()
	{
		//alert('真准');
	}//	

	one.onmouseout =function()
	{
		//alert('真走啊');
	}


	window.onmousemove =function(e)
	{
		//h获取鼠标的x和y的坐标
		var x = e.clientX;
		var y = e.clientY

		console.log('X:'+x+'===='+'Y'+y);
	}	
	

	window.onmousemove =function(e)
	{
		var x = e.clientX;
		var y = e.clientY;
		two.innerHTML ='X:'+x+'===='+'Y:'+y;
	}

		</script>
	
	
</body>	
</html>